package vn.com.shoppie.sobject;

import com.hoasua.adb.adbException;


@SuppressWarnings("serial")
public class Product extends ShoppieObject {
	public static final String CLASS_UNIQUE="Product";
	public static final int NUM_FIELDS=8;
	
	public String productId="";
	public String merchId="";
	public String productName="";
	public String longDesc="";
	public String likedNumber="";
	public String price="";
	public String oldPrice="";
	public String productImage="";
	
	public Product(int index, String[] values) {
		super(index, values);
		try {
			if (values.length != NUM_FIELDS)
				throw new adbException(CLASS_UNIQUE+" length values invalid!");
		} catch (adbException e) {
			e.printStackTrace();
		}
		
		this.productId=values[0];
		this.merchId=values[1];
		this.productName=values[2];
		this.longDesc=values[3];
		this.likedNumber=values[4];
		this.price=values[5];
		this.oldPrice=values[6];
		this.productImage=values[7];
	}
	
	public interface ProductColumn extends ShoppieObjectColumn{
		public static final String TABLE_NAME ="Product";
		public static final String LIKE_NUMBER ="likedNumber";
		public static final String LONG_DESC ="longDesc";
		public static final String MERCH_ID ="merchId";
		public static final String OLD_PRICE ="oldPrice";
		public static final String PRODUCT_ID ="productId";
		public static final String PRODUCT_IMAGE ="productImage";
		public static final String PRODUCT_NAME ="productName";
		public static final String PRICE ="price";
	}
}
